package func.study.groovy.call;

import groovy.lang.GroovyObject;

/**
 * Created by yao_pc on 2017/8/4.
 */
public class CallDynamicMethod {
    public static void main(String[] args) {
        GroovyObject instance = new DynamicGroovyClass();

        Object result = instance.invokeMethod("squeak", new Object[]{});
        System.out.println("received: " + result);

        Object result2 = instance.invokeMethod("quack", new Object[]{"like", "a", "duck"});
        System.out.println("received: " + result2);


    }


}
